Index: gtk+-3.24.31/gtk/gtkwindow.c
===================================================================
--- gtk+-3.24.31.orig/gtk/gtkwindow.c
+++ gtk+-3.24.31/gtk/gtkwindow.c
@@ -7376,6 +7376,16 @@ gtk_window_realize (GtkWidget *widget)
   window = GTK_WINDOW (widget);
   priv = window->priv;

+  if (g_getenv ("GTK_RELAX_RGBA") != FALSE) {
+    GdkScreen *screen;
+    GdkVisual *visual;
+    screen = gtk_widget_get_screen (widget);
+    visual = gdk_screen_get_rgba_visual (screen);
+
+    if (gdk_screen_is_composited (screen) && visual != NULL)
+        gtk_widget_set_visual (widget, visual);
+  }
+
   if (!priv->client_decorated && gtk_window_should_use_csd (window))
     create_decoration (widget);

